package seu.evaluation.metric;

import seu.xml.analysis.Diagram;
import seu.xml.analysis.UMLERDiagram;
/** 
 * @author samantha
 * 可维护性度量
 * 1）该类用于解析组件图，并将其存入MaintainabilityDiagram类中
 * 2）针对每个组件图：
 * 调用MaintainabilityMetricContext进行子属性度量，得到度量结果列表ArrayList<MetricResult>返回给该类
 */

public class MaintainabilityMetric extends Metric{
	
	private MaintainabilityDiagram maintainabilityDiagram;
	private MaintainabilityMetricContext mmc;	
	
	public MaintainabilityMetric( String path ){

		Diagram dg = new Diagram();									
		dg.readXML(path);
		maintainabilityDiagram = new MaintainabilityDiagram( new UMLERDiagram(dg) );
		mmc = new MaintainabilityMetricContext( maintainabilityDiagram );
		results=mmc.run();	
	}
	
	public static void main( String args[] ){
		MaintainabilityMetric mm = new MaintainabilityMetric( "Component.uxf" );
		mm.showResults();
		
		
	}
}




